﻿using System;
using System.Data;
using System.Collections.Generic;
namespace OnlineManagement.IDAL
{
	/// <summary>
	/// 接口层Sow
	/// </summary>
	public interface ISow
	{
		#region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		bool Exists(Guid SowID);

        bool Add(OnlineManagement.Model.Sow model, out string returnValue, out string sowIdStr);

        /// <summary>
        /// 使用存储过程更新一条记录
        /// </summary>
        bool Update(OnlineManagement.Model.Sow model,out string message);
		/// <summary>
		/// 删除一条数据
		/// </summary>
		bool Delete(Guid SowID);

        /// <summary>
        ///  使用存储过程删除一条数据
        /// </summary>
        bool Delete(Guid sowId, out string message);
		bool DeleteList(string SowIDlist );
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		OnlineManagement.Model.Sow GetModel(Guid SowID);
		OnlineManagement.Model.Sow DataRowToModel(DataRow row);
		/// <summary>
		/// 获得数据列表
		/// </summary>
		DataSet GetList(string strWhere);
		/// <summary>
		/// 获得前几行数据
		/// </summary>
		DataSet GetList(int Top,string strWhere,string filedOrder);
		int GetRecordCount(string strWhere);
        DataSet GetSowsByProc(int sowId, int currentPage);

        /// <summary>
        /// 获取可配种的母猪信息
        /// </summary>
        /// <param name="hoggeryId"></param>
        /// <returns></returns>
        DataSet GetHybridizationSow(int hoggeryId);

		DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex);
		/// <summary>
		/// 根据分页获得数据列表
		/// </summary>
		//DataSet GetList(int PageSize,int PageIndex,string strWhere);
		#endregion  成员方法

		#region  MethodEx

        DataSet GetSowSettingsInfo(int hoggeryId);

        DataSet GetSowActions();

        List<Model.SowOperations> GetSowOperations();

        DataSet GetSowDataPaging(int hoggeryId, int pageSize, int currentPage,string whereStr,string orderByStr, out int rCount);

        DataSet GetSowBasicInfo(Guid sowID,int hoggeryId);
        #endregion  MethodEx
	} 
}
